$(document).ready(function()
{
	/**
	* 订单查询
	*/	
	var ordersheet_button=$('#Ordersheet_Button');
	var ordersheet_shipyardName=$('#Ordersheet_ShipyardName');
	var ordersheet_shipownerName=$('#Ordersheet_ShipownerName');
	var ordersheet_shiponwerNationality=$('#Ordersheet_ShiponwerNationality');
	var ordersheet_amount=$('#Ordersheet_Amount');
	var ordersheet_giveDatetime_Year=$('#Ordersheet_GiveDatetime_Year');
	var ordersheet_giveDatetime_Month=$('#Ordersheet_GiveDatetime_Month');
	var ordersheet_datetime_Year=$('#Ordersheet_Datetime_Year');
	var ordersheet_datetime_Month=$('#Ordersheet_Datetime_Month');
	
	ordersheet_button.click(function()
	{
		var isNotWrite=ordersheet_shipyardName.val()==''&&ordersheet_shipownerName.val()=='';
		{
			isNotWrite=isNotWrite&&ordersheet_shiponwerNationality.val()==''&&ordersheet_amount.val()=='';
			isNotWrite=isNotWrite&&ordersheet_giveDatetime_Year.val()=='0'&&ordersheet_giveDatetime_Month.val()=='0';
			isNotWrite=isNotWrite&&ordersheet_datetime_Year.val()=='0'&&ordersheet_datetime_Month.val()=='0';			
		}

		if(isNotWrite)
		{
			ordersheet_shipyardName.focus();
			return false;
		}
		
		var location='/exec.php?action=shipyard_ordersheet&type=search';
		{
			if(ordersheet_shipyardName.val()!=''){
				location=location+'&shipyardname='+encodeURI(ordersheet_shipyardName.val());
			}
			
			if(ordersheet_shipownerName.val()!=''){
				location=location+'&shipownername='+encodeURI(ordersheet_shipownerName.val());
			}
			
			if(ordersheet_shiponwerNationality.val()!=''){
				location=location+'&shiponwernationality='+encodeURI(ordersheet_shiponwerNationality.val());
			}
			
			if(ordersheet_amount.val()!=''){
				location=location+'&amount='+encodeURI(ordersheet_amount.val());
			}
			
			if(ordersheet_giveDatetime_Year.val()!='0'){
				location=location+'&givedatetime_year='+ordersheet_giveDatetime_Year.val();
			}
			
			if(ordersheet_giveDatetime_Month.val()!='0'){
				location=location+'&givedatetime_month='+ordersheet_giveDatetime_Month.val();
			}
			
			if(ordersheet_datetime_Year.val()!='0'){
				location=location+'&datetime_year='+ordersheet_datetime_Year.val();
			}
			
			if(ordersheet_datetime_Month.val()!='0'){
				location=location+'&datetime_month='+ordersheet_datetime_Month.val();
			}			
		}
		
		window.location=location;
		
		return false;
	});
});